<{include file="public/header.html"}>
    <div class="new-loan mb60">
        <div class="header">
            <header class="m-head"><a href="<{eval url('loan/search')}>?kw=<{$hot_search}>" class="fr u-search iconfont" style=" margin-right: -15px;">&#xe7ba;</a><a href="<{eval url('index')}>" class="fr u-message iconfont disnone">&#xe66c;</a></header>
            <section class="banner-box seach-banner" style="padding: 0">
                <div class="index_banner main_visual">
                    <div class="banner-con main_image">
                        <ul>
                            <{foreach from=$banner_list item=val}>
                            <li><a href="<{$val['banner_link']}>"><img src="<{$val['banner_img']}>" alt=""></a></li>
                            <{/foreach}>
                        </ul>
                        <a class="btn-prev" id="btn-prev" href="javascript:;"><</a>
                        <a class="btn-next" id="btn-next" href="javascript:;">></a>
                    </div>
                    <div class="focus flicking_con">
                        <{foreach from=$banner_list item=val key=key}>
                        <a <{if $key == 0}>class="current"<{/if}> href="javascript:;"></a>
                        <{/foreach}>
                    </div>
                </div>
            </section>
        </div>
        <div class="newplats" style="display: none">
            <a href="<{eval url('loan/lists')}>"><img src="../../../static/weixin/img/newplats.png" alt=""></a>
        </div>
        <div class="pannel bordbottom10">
            <h4>极速入口</h4>
            <ul class="f-cb sort">
                <li><a href="<{eval url('s/1')}>"><img src="../../../static/weixin/img/12k.png" alt=""></a></li>
                <li><a href="<{eval url('s/2')}>"><img src="../../../static/weixin/img/25k.png" alt=""></a></li>
                <li><a href="<{eval url('s/3')}>"><img src="../../../static/weixin/img/510k.png" alt=""></a></li>
                <li><a href="<{eval url('s/4')}>"><img src="../../../static/weixin/img/1w.png" alt=""></a></li>
            </ul>
        </div>
        <div class="pannel">
            <h4 class="f-cb">热门贷款 <a class="fr" id="for-change" style="display: none" href="javascript:;"><b class="iconfont">&#xe66d;</b>换一换</a></h4>
            <ul id="content-list" class="hot-lists">

            </ul>
            <div class="loading" id="noresults" <{if $lend_list}>style="display: none;"<{/if}>>
            <a href="javascript:;" class="load-success empty-follow-data">没有任何数据哦</a>
        </div>
        <div class="loading" id="loading"  style="display: none;">
            <a class="/*pull-load*/ load-success" href="javascript:;">加载中...</a>
        </div>
        <div class="loading" id="nomoreresults" style="display: none;">
            <a href="javascript:;" class="load-success nomore-load">已经到底啦~~~</a>
        </div>
    </div>
    </div>

<{include file="public/footer_banner.html"}>
    <script type="text/javascript" src="/static/js/jquery.touchSlider.js"></script>
    <script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript" src="/static/js/scrollpagination.js"></script>
    <script type="text/javascript" src="/static/js/loan-min-1.0.js"></script>
<script type="text/javascript">


    var scrollPagination_obj = null;

    $(function(){
        var scro_ani = setTimeout(function () {
            $("html,body").animate({ scrollTop: 245 }, 2450);
        }, 3000);
        $("body").on("touchmove", function(e) {
            var globalTopHeight = $(document).scrollTop();
            if(Number(globalTopHeight) > 0) {
                clearTimeout(scro_ani);
            }
        });

        if(parseInt("<{$amount_id}>") > 0){
            LOAN_CIG.amountId = "<{$amount_id}>";
            //console.log(LOAN_CIG.pageIndex);
        }
        $('#content-list').scrollPagination({
            'contentPage': "/ajax/ajax_index_more_loan_json",
            'contentData': {
                'amount_id': LOAN_CIG.amountId,
                'period_id':LOAN_CIG.periodId,
                'lend_id':LOAN_CIG.lendType,
                'keyWord':LOAN_CIG.keyWord,
                'orderby': LOAN_CIG.orderBy,
                'pageIndex': LOAN_CIG.pageIndex
            },
            'scrollTarget': $(window),
//            'heightOffset': 0,
            'initLoad':function(){
                scrollPagination_obj = this;
            },
            'beforeLoad': function() { // before load function, you can display a preloader div
                $('#loading').fadeIn('fast');
                $('#loading').attr('scrollpagination','disabled');
            },
            'afterLoad': function(elementsLoaded) { // after loading content, you can use this function to animate your new elements
                //console.log(elementsLoaded);
                $('#loading').fadeOut('fast');
                $('#loading').attr('scrollpagination','enabled');
                if (elementsLoaded.length == 0) {
                    $('#nomoreresults').fadeIn('slow');
                    $('#content-list').stopScrollPagination();
                }else{
                    LOAN_CIG.pageIndex = LOAN_CIG.pageIndex + 1;
                    //console.log(LOAN_CIG.pageIndex)
                }

                this.contentData.pageIndex = LOAN_CIG.pageIndex;
                $(elementsLoaded).fadeInWithDelay();

            }
        })
        $.fn.fadeInWithDelay = function() {
            var delay = 0;
            return this.each(function() {
                $(this).delay(delay).animate({
                    opacity: 1
                }, 200);
                delay += 100;
            });
        };
    });
</script>
<{include file="public/footer.html"}>